package com.dragon.app.ykd.vo;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.dragon.loan.entity.AcCaseStatusTrace;
import com.dragon.loan.entity.AcLoanApplyInfo;

public class UserFullVO  implements Serializable{
	private static final long serialVersionUID = 1L;

	/**
	 * 信息完整度判断-完整
	 */
	public static final String USER_FULL_COMPLETE = "3";
	
	private String personalData = "1"; // 123
	private String zhimaCredit = "1"; // 123
	private String sesameIdent = "1"; //芝麻分：1未认证，3认证成功
	private String operatorData = "1"; // 123
	/**
	 * 1 未完成 2 认证中 3 认证成功 4认证失败
	 */
	private String gjjStatus = "1";

	/**
	 * 1 未完成 2 认证中 3 认证成功 4认证失败
	 */
	private String socialStatus;
	private String mobileNum;
	List<AcCaseStatusTrace> loanProgerss;//贷款处理过程
	private String bill = "1";
	//时间征信数据完成度
	private String timeValidFlag;
	
	private String employFlag;//就业贷信息是否完成标识
	/**
	 * 是否已经去到征信报告 1 未完成 2 认证中 3 认证成功
	 */
	private String creditReportFlag;
	/**
	 * 卡牛网银数据获取：1 未完成 2 认证中 3 认证成功 4认证失败
	 */
	private String kaNiuBankInfoStatus;
	/**
	 * 卡牛房贷卡数据获取：1 未完成 2 认证中 3 认证成功 4认证失败
	 */
	private String kaNiuMortgageInfoStatus;
	
	
	public static String getPersonalDataValue(AcLoanApplyInfo loan) {
		// 判断是否是全部为空
		if (StringUtils.isEmpty(loan.getEducationLevelId()) && StringUtils.isEmpty(loan.getMarriageId())
				&& StringUtils.isEmpty(loan.getProvinceId()) && StringUtils.isEmpty(loan.getLiveTypeId())
				&& StringUtils.isEmpty(loan.getCityId()) && StringUtils.isEmpty(loan.getAddress())
				&& StringUtils.isEmpty(loan.getWorkTypeId()) && StringUtils.isEmpty(loan.getOfficePhone())
				&& StringUtils.isEmpty(loan.getCompanyAddress()) && StringUtils.isEmpty(loan.getCompanyName())
				&& StringUtils.isEmpty(loan.getCompanyCityId())
				&& StringUtils.isEmpty(loan.getEmail())
				&& StringUtils.isEmpty(loan.getWeixingNo())
				&& StringUtils.isEmpty(loan.getQqNo())
				&& StringUtils.isEmpty(loan.getXinlangWbNo())
				)
			return "1";

		// 自有职业者
		if ("2".equals(loan.getWorkTypeId())) {
			// 判断是否是全部为空
			if (StringUtils.isNotEmpty(loan.getEducationLevelId()) && StringUtils.isNotEmpty(loan.getMarriageId())
					&& StringUtils.isNotEmpty(loan.getProvinceId()) && StringUtils.isNotEmpty(loan.getLiveTypeId())
					&& StringUtils.isNotEmpty(loan.getCityId()) && StringUtils.isNotEmpty(loan.getAddress())
					&& StringUtils.isNotEmpty(loan.getWorkTypeId()))
				return "3";

			return "2";
		}

		// 判断是否是全部为空
		if (StringUtils.isNotEmpty(loan.getEducationLevelId()) && StringUtils.isNotEmpty(loan.getMarriageId())
				&& StringUtils.isNotEmpty(loan.getProvinceId()) && StringUtils.isNotEmpty(loan.getLiveTypeId())
				&& StringUtils.isNotEmpty(loan.getCityId()) && StringUtils.isNotEmpty(loan.getAddress())
				&& StringUtils.isNotEmpty(loan.getWorkTypeId()) && StringUtils.isNotEmpty(loan.getOfficePhone())
				&& StringUtils.isNotEmpty(loan.getCompanyAddress()) && StringUtils.isNotEmpty(loan.getCompanyName())
				&& StringUtils.isNotEmpty(loan.getCompanyCityId())
				&& StringUtils.isNotEmpty(loan.getEmail())
				&& StringUtils.isNotEmpty(loan.getPositionType()))
			return "3";

		return "2";
	}
	
	/**
	 * 判断信息是否完整
	 * wanggang
	 * @return
	 */
	public boolean isInfoComplete() {
		if (USER_FULL_COMPLETE.equals(this.getOperatorData()) && USER_FULL_COMPLETE.equals(this.getPersonalData())
				&& USER_FULL_COMPLETE.equals(this.getZhimaCredit()) && USER_FULL_COMPLETE.equals(this.getSocialStatus())
				&& USER_FULL_COMPLETE.equals(this.getBill()) && USER_FULL_COMPLETE.equals(this.getGjjStatus())
				&& USER_FULL_COMPLETE.equals(this.getKaNiuBankInfoStatus()) && USER_FULL_COMPLETE.equals(this.getSesameIdent())
				&& USER_FULL_COMPLETE.equals(this.getTimeValidFlag()) && USER_FULL_COMPLETE.equals(this.getEmployFlag()))
			return true;
		else
			return false;
	}
	
	public String getEmployFlag() {
		return employFlag;
	}

	public void setEmployFlag(String employFlag) {
		this.employFlag = employFlag;
	}

	public String getKaNiuMortgageInfoStatus() {
		return kaNiuMortgageInfoStatus;
	}

	public void setKaNiuMortgageInfoStatus(String kaNiuMortgageInfoStatus) {
		this.kaNiuMortgageInfoStatus = kaNiuMortgageInfoStatus;
	}
	
	public String getTimeValidFlag() {
		return timeValidFlag;
	}

	public void setTimeValidFlag(String timeValidFlag) {
		this.timeValidFlag = timeValidFlag;
	}

	public String getKaNiuBankInfoStatus() {
		return kaNiuBankInfoStatus;
	}

	public void setKaNiuBankInfoStatus(String kaNiuBankInfoStatus) {
		this.kaNiuBankInfoStatus = kaNiuBankInfoStatus;
	}

	public String getCreditReportFlag() {
		return creditReportFlag;
	}

	public void setCreditReportFlag(String creditReportFlag) {
		this.creditReportFlag = creditReportFlag;
	}

	public String getBill() {
		return bill;
	}

	public void setBill(String bill) {
		this.bill = bill;
	}

	public String getMobileNum() {
		return mobileNum;
	}

	public void setMobileNum(String mobileNum) {
		this.mobileNum = mobileNum;
	}

	public String getPersonalData() {
		return personalData;
	}

	public void setPersonalData(String personalData) {
		this.personalData = personalData;
	}

	public String getZhimaCredit() {
		return zhimaCredit;
	}

	public String getSocialStatus() {
		return socialStatus;
	}

	public void setSocialStatus(String socialStatus) {
		this.socialStatus = socialStatus;
	}

	public void setZhimaCredit(String zhimaCredit) {
		this.zhimaCredit = zhimaCredit;
	}

	public String getOperatorData() {
		return operatorData;
	}

	public void setOperatorData(String operatorData) {
		this.operatorData = operatorData;
	}

	public List<AcCaseStatusTrace> getLoanProgerss() {
		return loanProgerss;
	}

	public void setLoanProgerss(List<AcCaseStatusTrace> loanProgerss) {
		this.loanProgerss = loanProgerss;
	}

	public String getGjjStatus() {
		return gjjStatus;
	}

	public void setGjjStatus(String gjjStatus) {
		this.gjjStatus = gjjStatus;
	}

	public String getSesameIdent() {
		return sesameIdent;
	}

	public void setSesameIdent(String sesameIdent) {
		this.sesameIdent = sesameIdent;
	}
	
}
